package cn.edu.javaweb.superServlet;
import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import cn.edu.javaweb.utils.DBUtil;
@WebServlet("/UpdateNotice02")
public class UpdateNotice02 extends HttpServlet {
	private static final long serialVersionUID = 1L;
	DBUtil db; //声明对象 一定要赋值  否则空指针异常
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		//设置Register.html里的编码
		request.setCharacterEncoding("utf-8");
		String id=request.getParameter("id");	
		String title=request.getParameter("title");
		String content=request.getParameter("content");
		String target=request.getParameter("target");
		String place=request.getParameter("place");
		String Stime=request.getParameter("Stime");
		String Etime=request.getParameter("Etime");
		System.out.println(title);
		System.out.println(target);
		System.out.println(place);


		HttpSession session = request.getSession(true);
		request.setAttribute("id",id); 
		request.setAttribute("title", title);
		request.setAttribute("content", content);
		request.setAttribute("target", target);
		request.setAttribute("place", place);
		request.setAttribute("Stime", Stime);
		request.setAttribute("Etime", Etime);
		request.getRequestDispatcher("/volunteer/super/UpdateNotice.jsp").forward(request, response);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doGet(request, response); 
	}

}
